﻿using CnBlogsCore.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace CnBlogsClient.Cells
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class NewsItemCell : ViewCell
    {
        public NewsItemCell()
        {
            InitializeComponent();
        }

        protected override void OnBindingContextChanged()
        {
            this.ffimageloadingControl.Source = null;
            var item = BindingContext as News;

            if (item == null)
                return;

            this.ffimageloadingControl.Source = item.TopicIcon;

            base.OnBindingContextChanged();
        }
    }
}